/**
 * 引用计数算法
 */

const user1 = { age: 11 }
const user2 = { age: 22 }
const user3 = { age: 33 }

const nameList = [user1.age, user2.age, user3.age,]

function fn () {
  const num1 = 1
  const num2 = 2
}

// 函数执行完之后，从根上找不到num1，num2，引用数字为0，函数内存空间被回收
fn()
